<x-filament-panels::page>

{{--    <livewire:search-bar />--}}



    <h1 class="text-center">{{ \app\Models\Project::find($project_id)->title}}</h1>

    <div class="flex gap-2">
        @if($save_status === 'saved')
            <a href="/user/components/{{$project_id}}/unsaved" class="bg-gray-800 text-white hover:bg-gray-700 py-4 px-6 rounded-xl shadow-md transition duration-200">返回选择组件</a>
            <a href="/download" class="bg-gray-800 text-white hover:bg-gray-700 py-4 px-6 rounded-xl shadow-md transition duration-200">下载项目 ( 含{{ \Illuminate\Support\Facades\DB::table('component_project_type')->where('project_id', $project_id)->count() }}个组件)</a>
        @else
            <a href="/user/components/{{$project_id}}/saved" class="bg-gray-800 text-white hover:bg-gray-700 py-4 px-6 rounded-xl shadow-md transition duration-200">已保存的组件({{ \Illuminate\Support\Facades\DB::table('component_project_type')->where('project_id', $project_id)->count() }})</a>
        @endif

    </div>

    @livewire('component-list', ['project_id' => $project_id, 'save_status' => $save_status])

</x-filament-panels::page>
